import request from '@/config/axios'

// 教师 VO
export interface TeacherVO {
  id: number // 编号
  departId: number // 部门编号
  teacherNo: string // 工号
  password: string // 密码
  email: string // 邮箱
  realName: string // 真实姓名
  nickName: string // 艺名
  gender: number // 性别
  birthday: Date // 生日
  hiredate: Date // 入职时间
  title: number // 职称
  teacherState: number // 教师状态
  description: string // 个人介绍
}

// 教师 API
export const TeacherApi = {
  // 查询教师分页
  getTeacherPage: async (params: any) => {
    return await request.get({ url: `/td/teacher/page`, params })
  },

  // 查询教师详情
  getTeacher: async (id: number) => {
    return await request.get({ url: `/td/teacher/get?id=` + id })
  },

  // 新增教师
  createTeacher: async (data: TeacherVO) => {
    return await request.post({ url: `/td/teacher/create`, data })
  },

  // 修改教师
  updateTeacher: async (data: TeacherVO) => {
    return await request.put({ url: `/td/teacher/update`, data })
  },

  // 删除教师
  deleteTeacher: async (id: number) => {
    return await request.delete({ url: `/td/teacher/delete?id=` + id })
  },

  // 导出教师 Excel
  exportTeacher: async (params) => {
    return await request.download({ url: `/td/teacher/export-excel`, params })
  },
}